//
//  UIAlertAction+ActionIndex.m
//  AlertControllerDemo
//
//  Created by wei wang on 2017/10/14.
//  Copyright © 2017年 weiwang. All rights reserved.
//

#import "UIAlertAction+ActionIndex.h"
#import <objc/runtime.h>

static void *actionKey = "actionKey";

@implementation UIAlertAction (ActionIndex)

- (void)setActionIndex:(NSInteger)actionIndex {
    objc_setAssociatedObject(self, actionKey, @(actionIndex), OBJC_ASSOCIATION_ASSIGN);
}

- (NSInteger)actionIndex {
    return [objc_getAssociatedObject(self, actionKey) integerValue];
}

@end
